<!doctype html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

	<meta name="renderer" content="webkit">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>风险防控</title>

    <!-- Bootstrap -->
    <link href="../../css/bootstrap/bootstrap.min.css" rel="stylesheet">
	<link href="../../css/bootstrap/customOA.css" rel="stylesheet">
	<link href="../../css/site/page.css" rel="stylesheet" type="text/css" />
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <script src="../../js/require.js"></script>
    <!--[if lt IE 9]>
    	 <script>
			require(['../../js/appConf'], function() {
			    require(['jquery','html5shiv','respond'], function() {
					
			    });
			});
		</script>      
    <![endif]-->
  </head>
  <body>
 <div id="preview-file" class="container">
	<div class="row">
		<div class="modal-title"></div>
		<div class="modal-body"></div>
	</div>	
	
</div>


<script type="text/javascript" src="../../js/require.js"></script>
<script type="text/javascript">
require(['../../js/appConf','../js/bsConfig'], function() {

    require(['init','bsMsgServ','domReady!'], function(init,bsMsgServ,doc) {		
		
		var rootid = 'preview-file';
		var funcDef = {
				
			/*
			* 初始化
			*
			*/
			init:function(data){
				
				if(data){
					var _title = $('#'+rootid + ' .modal-title')
					var _content = $('#'+rootid + ' .modal-body')
					
					if(window.console){
						console.log('_title length: ' + _title.length + ' , _content.length: ' +_content.length);
					}
					if(data){
						if(data.fileName){
							window.document.title = data.fileName;
							
						}
						if(data.content){
							$(_content).append('<font>'+data.fileName+'</font>')
							$(_content).append(data.content)	
						}
					}					
					
				}
			}
			
			
		}
		
		var _param = window.location.search
		
		
		var _parray = _param.substring(1).split('=');
		if(window.console){
			console.log('param: ' + _param);
		}
		var _id;
		
		if(window.console){
			console.log('_parray length: ' + _parray.length);
		}							
					
		if(_parray.length=2){
			if(_parray[0]=='id'){
				_id = _parray[1]
			}							
		}
			
		
		
		
		$.ajax({
			url:'/oa/upload/previewFile.action',
			data:{id:_id},
			success:funcDef.init,
			error:function(){
				bsMsgServ.warnSlide();
			}
		})
    });    
});
</script>

</body>
</html>